import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * @BelongsPackage: PACKAGE_NAME
 * @Author: linqh03
 * @CreateTime: 2020-11-13 17:09
 * @Description: 序列化
 */
public class Serializeable {

    class Person implements Serializable {
        transient String username;
        Integer age;

        public Person(String username, Integer age) {
            this.username = username;
            this.age = age;
        }

        public String getUsername() {
            return username;
        }

        public Integer getAge() {
            return age;
        }
    }

    public static void main(String[] args) {
       Person person = new Serializeable().new Person("aa",20);
        System.out.println(JSON.toJSONString(person));
    }
}
